package com.itqf.mybatis;

import com.itqf.mapper.AuthorMapper;
import com.itqf.pojo.Author;
import com.itqf.utils.SqlSessionUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.ArrayList;
import java.util.List;

/**
 * projectName: mybatisgp8
 *
 * @author: 赵伟风
 * time: 2021/7/30 16:59
 * description:使用动态if
 */
public class UseIf {

    public static void main(String[] args) {

        SqlSession sqlSession = SqlSessionUtils.openSession();


        AuthorMapper mapper = sqlSession.getMapper(AuthorMapper.class);

        List<Author> authors = mapper.queryLike("",10);


        List<Integer> ids = new ArrayList<>();
        ids.add(1);
        ids.add(2);

        List<Author> authors1 = mapper.queryIds(ids);

        System.out.println("authors1 = " + authors1);


        System.out.println("authors = " + authors);

        sqlSession.close();


    }

}
